package exfist;

/**
 * @author brianmaccarthy
 */

import java.awt.Point;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;

public class Collisions 
{
	/**
	 * TODO: find a way of scanning B&W images to get per pixel collision.
	 * you're going to need to raster the image,use it for the bounding box and pixel detection
	 */
	private Point p;
	private int rightside,bottom;
	private boolean is_collidable;
	private Raster ras;
	
	public Collisions()
	{
		this(null,null,false);
	}
	
	public Collisions(Point new_p, BufferedImage sprite,boolean collidable)
	{

		p=new_p;
		rightside=p.x+sprite.getWidth();
		bottom=p.y+sprite.getHeight();
		is_collidable = collidable;
		ras = sprite.getData();
	}
	
	public void checkCollisions(Collisions c)
	{
//		this is the basic idea for the outer hitbox
		if(this.rightside > c.p.x && this.p.x < c.rightside) //overlaps horizontally
		{
			if(this.bottom>c.p.y && this.p.y<c.bottom) //overlaps vertically
			{
				// true;
			}
			
		}
			// false;
	}
	
}
